import http from './http'
const BASE_URL = 'http://192.168.221.213:8002'
export default {
    //初始化折扣数据
    discountData() {
        return http({
            url: `${BASE_URL}/service_market/findAllDiscount`,
            method: 'post',
        })
    },
    //限时折扣列表条件查询
    setDiscountData(obj) {
        return http({
            url: `${BASE_URL}/service_market/findAllDiscount`,
            method: 'post',
            data: { obj }
        })
    },
    // 点击数据弹框
    setMetadata(obj) {
        return http({
            url: `${BASE_URL}/service_market/selectDiscountController`,
            method: 'post',
            data: obj
        })
    },

    // 点击停用请求
    stopData(obj) {
        return http({
            url: `${BASE_URL}/service_market/deactivateDiscount`,
            method: 'post',
            data: obj
        })
    },
    //点击新增请求
    addDiscount(obj) {
        return http({
            url: `${BASE_URL}/service_market/insertDiscount`,
            method: 'post',
            data: obj
        })
    },
    //获取新建折扣列表请求
    addgetData() {
        return http({
            url: `${BASE_URL}/service_market/selectDiscountGoods`,
            method: 'post',
        })
    },
    //获取新建折扣添加商品请求
    addDiscountData(obj) {
        return http({
            url: `${BASE_URL}/service_market/selectGoods`,
            method: 'post',
            data: { obj }
        })
    },
    //新建折扣添加商品请求删除
    delDiscount(obj) {
        return http({
            url: `${BASE_URL}/service_market/DiscountGoodsDelete`,
            method: 'post',
            data: { discountId: obj }
        })
    },
    //新建折扣商品修改请求
    editDiscount(obj) {
        console.log(obj);
        return http({
            url: `${BASE_URL}/service_market/DiscountGoodsUpdate`,
            method: 'post',
            data: obj

        })
    },
}